home *** CD-ROM | disk | FTP | other *** search
-
- #ifdef MPW
- # pragma segment TCL_MACUTIL
- #endif
-
-
- #include "tclInt.h"
- #include "errMac.h"
-
- int macintoshErr = 0;
-
- char *
- Tcl_MacErrorID(errno)
- int errno;
- {
- static char macMsg[64];
-
- sprintf(macMsg, "Error #%d", errno);
- return macMsg;
- }
-
- char *
- Tcl_MacError (interp)
- Tcl_Interp *interp;
- {
- int idx;
- char *id, *msg;
-
- id = Tcl_MacErrorID(macintoshErr);
- for ( idx = 0 ; (ErrorCodeTab [idx].errNum != macintoshErr) &&
- (ErrorCodeTab [idx].errNum != -1);
- idx++ )
- ;
- msg = ErrorCodeTab[idx].errCode;
- Tcl_SetErrorCode(interp, "MAC", id, msg, (char *) NULL);
- return msg;
- }
-
- char *
- Tcl_MacGetError (interp, error)
- Tcl_Interp *interp;
- int error;
- {
- int idx;
- char *id, *msg;
-
- id = Tcl_MacErrorID(error);
- for ( idx = 0 ; (ErrorCodeTab [idx].errNum != error) &&
- (ErrorCodeTab [idx].errNum != -1);
- idx++ )
- ;
- msg = ErrorCodeTab[idx].errCode;
- Tcl_SetErrorCode(interp, "MAC", id, msg, (char *) NULL);
- return msg;
- }
-